/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */

package util.ejb;

import entities.tools.FilledForm;
import entities.tools.Form;
import java.util.List;
import javax.ejb.Local;

/**
 *
 * @author Marek
 */
@Local
public interface FilledFormBeanInterface {

    /**
     * Method creates new FilledForm instance
     * @return new FilledForm instance
     */
    FilledForm createFilledForm();

    /**
     * Method deletes specified by detachedFilledForm entity
     * @param detachedFilledForm
     * @return true if operation succeeded, false - if not
     */
    boolean deleteFilledForm(FilledForm detachedFilledForm);

    /**
     * Method find in the detabase entity specified by id parameter, and returns this entity
     * @param id
     * @return founded FilledForm
     */
    FilledForm getFilledForm(Long id);

    
    /**
     * Method find in the detabase entity specified by linkHash parameter, and returns this entity
     * @param linkHash
     * @return founded FilledForm
     */
    FilledForm getFilledForm(String linkHash);
    
    
    /**
     * Method returns all FilledForm entities from the database
     * @return all FilledForm from the database
     */
    List<FilledForm> getFilledForms();

    /**
     * Method updates in the database, specified by detachedFilledForm entity
     * @param detachedFilledForm
     * @return true if operation succeeded, false - if not
     */
    boolean updateFilledForm(FilledForm detachedFilledForm);
    
    
     /**
     * Method returns the raport, containing data of last 100 created filledForm linked with one specified by param form, Form entity 
     * @param form
     * @return raport saved 
     */
     List<FilledForm> getLastlyCreatedFilledForms(Form form, int numberOfRecords);
}
